package com.panshi.service.impl;

import com.panshi.mapper.UserLoginMapper;
import com.panshi.service.IUserLoginService;
import com.panshi.tools.UserLogin;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserLoginServiceImpl implements IUserLoginService {

    @Autowired
    private UserLoginMapper loginMapper;

    /***
     * 登录
     * @param userMail
     * @return
     */
    @Override
    public UserLogin queryUserByUserName(String userMail){
        return loginMapper.queryUserByUserName(userMail);
    }

    /***
     * 注册
     * @param userLogin
     */
    @Override
    public void addUser(UserLogin userLogin) {
        loginMapper.addUser(userLogin);
    }

    /***
     * 忘记密码 更改密码
     * @param userLogin
     */
    @Override
    public void forgetPassword(UserLogin userLogin) {
        loginMapper.forgetPassword(userLogin);
    }

}
